<!DOCTYPE html>
<html>
  <head>
    <title>简单计算器</title>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width">
    <link rel="icon" href="favicon.ico" />
  </head>
  <body>
    <input id="num1" /> * <input id="num2" />
    <button onclick="cal()"> = </button>
    <input id="num3" />
    <script>
       function cal(){
	num3.value=num1.value * num2.value;
	}
    </script>

    <br>

    <input id="num4" /> / <input id="num5" />
    <button onclick="cal2()"> = </button>
    <input id="num6" />
    <script>
       function cal2(){
	num6.value=num4.value / num5.value;
	}
    </script>

<br>

    <input id="num7" /> + <input id="num8" />
    <button onclick="cal3()"> = </button>
    <input id="num9" />
    <script>
       function cal3(){
	num9.value=parseInt(num7.value) + parseInt(num8.value);
	}
    </script>

<br>

    <input id="num10" /> - <input id="num11" />
    <button onclick="cal4()"> = </button>
    <input id="num12" />
    <script>
       function cal4(){
	num12.value=num10.value - num11.value;
	}
    </script>
  </body>
</html>